import {defineConfig} from 'vite'
//@ts-ignore
import JsxModelTransform from 'plain-design-composition/plugins/vite-plugin-react-jsx-model'
import react from '@vitejs/plugin-react'
import path from 'path'

const resolve = (filePath: string) => path.resolve(__dirname, './', filePath)

// https://vitejs.dev/config/
export default defineConfig({
    base: '/react-cms-visual-editor/',
    build: {
        outDir: 'docs',
        rollupOptions: {
            input: {
                main: resolve('index.html'),
                preview: resolve('preview.html')
            }
        },
    },
    plugins: [react(), JsxModelTransform()]
})
